
<template>
  <div>
    <div class="table-layout">
      <el-card shadow="never">
        <div style="width: 500px;">
          <SubmitForm label-position="left" label-width="80px" :form-list="formList" :rule-form="ruleForm"></SubmitForm>
        </div>
      </el-card>
      <div style="height: 20px"></div>
      <el-card shadow="never">
        <div slot="header" class="clearfix">
          <span>申请列表</span>
        </div>
        <div class="table-box">
          <el-table
              border
              v-loading="loading"
              max-height="420px"
              :data="tableData"
              element-loading-spinner="el-icon-loading"
              element-loading-background="rgba(255, 255, 255, 0.8)"
              @selection-change="onSelect"
          >
            <el-table-column align="center" v-for="item in columns" :key="item.prop" :prop="item.prop" :label="item.label">
              <template slot-scope="scope">
            <span v-if="item.type === 'select'">
              {{ item.mapping[scope.row[item.prop]] }}
            </span>
                <span v-else>{{ scope.row[item.prop] }}</span>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div class="page-box">
          <el-pagination
              background
              :current-page="pageNo"
              :page-sizes="pageSizes"
              :page-size="pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="totalSize"
              @size-change="changePageSize"
              @current-change="changePageNo"
          />
        </div>
      </el-card>
    </div>
  </div>
</template>
<script>

import crud from "@/mixins/crud";
import SubmitForm from "@/components/SubmitForm.vue";

export default {
  name: "index",
  components: {SubmitForm},
  mixins: [crud],
  data() {
    return {
      columns: [
        // 平台订单号、金额、客户姓名、客户邮箱、申请时间、链接
        { label: '平台订单号', prop: 'orderNo' },
        { label: '金额', prop: 'amount' },
        { label: '客户姓名', prop: 'customerName' },
        { label: '客户邮箱', prop: 'customerEmail' },
        { label: '申请时间', prop: 'applyTime' },
        { label: '链接', prop: 'link' },
      ],
      formList: [
        {
          label: '收款通道',
          prop: 'channel',
          name: 'select',
          options: [
          ],
          rules: [
            {
              required: true,
              message: '请选择收款通道',
              trigger: 'change'
            }
          ]
        },
          // 收款金额、客户姓名、客户邮箱
        {
          label: '收款金额',
          prop: 'amount',
          name: 'input',
          rules: [
            {
              required: true,
              message: '请输入收款金额',
              trigger: 'blur'
            }
          ]
        },
        {
          label: '客户姓名',
          prop: 'customerName',
          name: 'input',
          rules: [
            {
              required: true,
              message: '请输入客户姓名',
              trigger: 'blur'
            }
          ]
        },
        {
          label: '客户邮箱',
          prop: 'customerEmail',
          name: 'input',
          rules: [
            {
              required: true,
              message: '请输入客户邮箱',
              trigger: 'blur'
            }
          ]
        }
      ],
      ruleForm: {},
    }
  }
}
</script>

<style scoped lang="scss">

</style>
